package entity;

import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

/**
 * Created by xuweijie on 2017/4/20.
 * 顾客类实体
 */
@Entity
@Table(name = "cro_customer")
@DynamicInsert(true)
//@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class CroCustomer implements Serializable {

    private String id;
    private String type;
    private String username;
    private String passwd;
    private String salt;
    private String sex;
    private String phone;
    private String email;
    private double balance;
    private Date signdate;
    private Date updatedate;
    private String photo;
    private String del_flag;
    private String freeze_flag;



    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(columnDefinition ="varchar(10) default '0'")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    @CreationTimestamp
    public Date getSigndate() {
        return signdate;
    }

    public void setSigndate(Date signdate) {
        this.signdate = signdate;
    }

    @UpdateTimestamp
    public Date getUpdatedate() {
        return updatedate;
    }

    public void setUpdatedate(Date updatedate) {
        this.updatedate = updatedate;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    @Column(columnDefinition ="varchar(1) default '0'")
    public String getDel_flag() {
        return del_flag;
    }

    public void setDel_flag(String del_flag) {
        this.del_flag = del_flag;
    }

    @Column(columnDefinition ="varchar(1) default '0'")
    public String getFreeze_flag() {
        return freeze_flag;
    }

    public void setFreeze_flag(String freeze_flag) {
        this.freeze_flag = freeze_flag;
    }
}
